import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AlarmDataVO, AlarmDataForm, AlarmDataQuery } from '@/api/system/alarmData/types';

/**
 * 查询人员定位报警列表
 * @param query
 * @returns {*}
 */

export const listAlarmData = (query?: AlarmDataQuery): AxiosPromise<AlarmDataVO[]> => {
  return request({
    url: '/system/alarmData/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询人员定位报警详细
 * @param id
 */
export const getAlarmData = (id: string | number): AxiosPromise<AlarmDataVO> => {
  return request({
    url: '/system/alarmData/' + id,
    method: 'get'
  });
};

/**
 * 新增人员定位报警
 * @param data
 */
export const addAlarmData = (data: AlarmDataForm) => {
  return request({
    url: '/system/alarmData',
    method: 'post',
    data: data
  });
};

/**
 * 修改人员定位报警
 * @param data
 */
export const updateAlarmData = (data: AlarmDataForm) => {
  return request({
    url: '/system/alarmData',
    method: 'put',
    data: data
  });
};

/**
 * 删除人员定位报警
 * @param id
 */
export const delAlarmData = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/alarmData/' + id,
    method: 'delete'
  });
};
